This R Markdown document is made to interactively update and view the DFO region where sightings records occur prior to import in the WSDB using leaflet

REQUIREMENTS:

  1. An input file - formatted Excel sheet with two tabs:
    1. a sighting data sheet prepped with clean coordinate (LATITUDE/LONGITUDE) and species code (SPECIES_CD) info that will be used for DFO region assignment and will be checked for “land whales.”
    2. a “species codes” tab in the input sheet or separate xlsx in the input folder with a tab called “species codes.” This defines the list of species codes and associated species names (This is currently specified as a separate xlsx in “species” object below)

The name of input files needs to be manually updated in this Rmarkdown script in the code block below —>

# INPUTS NEED TO BE CSV files, file names are specified in quotations here:
input_file <-"ECSASValidatedEntry2024.csv"
species = "speciesCodes.csv" 
#source lat long conversion function
source("scripts/LatLong_convert.R")
  1. The correct folder structure and file names:

If you want an html map file and subfolder of html files for use outside of R, change save_map to TRUE

save_map = F

Confirm DFO REGION of the points on a map

Region boundary spatial data sources:

    MAR - From DFO Open Gov region shapefile + NAFO
    QC - From DFO Open Gov region shapefile + input from GULF
    NL - From DFO Open Gov region shapefile + NAFO
    GULF - From DFO Open Gov region shapefile + input from GULF
    AR - From DFO Open Gov region shapefile + NAFO 0A/0B
    O&P - From DFO Open Gov land region shapefile
    PAC - From DFO Open Gov land region shapefile & EEZ
    OTHER - Other - anywhere outside Canada EEZ (e.g., St. Pierre)

Visual check for errors if any of the points are on land.

This will also be noted in the csv output in the variable field “land” for any records that overlap with the land polygon shapefile.